Logical and Computational Aspects of Programming with Sets/Bags/Lists

نویسندگان

  • Val Tannen
  • Ramesh Subrahmanyam
چکیده

We study issues that arise in programming with primitive recursion over non-free datatypes such as lists, bags and sets. Programs written in this style can lack a meaning in the sense that their outputs may be sensitive to the choice of input expression. We are, thus, naturally led to a set-theoretic denotational semantics with partial functions. We set up a logic for reasoning about the definedness of terms and a deterministic and terminating evaluator. The logic is shown to be sound in the model, and its recursion free fragment is shown to be complete for proving definedness of recursion free programs. The logic is then shown to be as strong as the evaluator, and this implies that the evaluator is compatible with the provable equivalence between different set (or bag, or list) expressions. Oftentimes, the same non-free datatype may have different presentations, and it is not clear a priori whether programming and reasoning with the two presentations are equivalent. We formulate these questions, precisely, in the context of alternative presentations of the list, bag, and set datatypes and study some aspects of these questions. In particular, we establish back-and-forth translations between the two presentations, from which it follows that they are equally expressive, and prove results relating proofs of program properties, in the two presentations. Comments University of Pennsylvania Department of Computer and Information Science Technical Report No. MSCIS-91-29. This technical report is available at ScholarlyCommons: http://repository.upenn.edu/cis_reports/382 Logical and Computational Aspects Of Programming With Sets/Bags/Lists MS-CIS-91-29 LOGIC & COMPUTATION 31 Val Breazu-Tannen Ramesh Subrahmanyam Department of Computer and Information Science School of Engineering and Applied Science University of Pennsylvania Philadelphia, PA 19104-6389 Revised October 1991 This paper has appeared in the Proceedings of ICALP '91 Logical and Computational Aspects of Programming with Sets/Bags/Lists Val Breazu-Tannen Ramesh Subrahmanyam Department of Computer and Information Science University of Pennsylvania 200 South 33rd St., Philadelphia, PA 19104, USA E-mail: [email protected], [email protected] Abstract. We study issues that arise in programming with primitive recursion over non-free datatypes such as lists, bags and sets. Programs written in this style can lack a meaning in the sense that their outputs may be sensitive to the choice of input expression. We are, thus, naturally lead to a set-theoretic denotational semantics with partial functions. We set up a logic for reasoning about the definedness of terms and a deterministic and terminating evaluator. The logic is shown to be sound in the model, and its recursion free fragment is shown to be complete for proving definedness of recursion free programs. The logic is then shown to be as strong as the evaluator, and this implies that the evaluator is compatible with the provable equivalence between different set (or bag, or list) expressions . Oftentimes, the same non-free datatype may have different presentations, and it is not clear a priori whether programming and reasoning with the two presentations are equivalent. We formulate these questions, precisely, in the context of alternative presentations of the list, bag, and set datatypes and study some aspects of these questions. In particular, we establish back-and-forth translations between the two presentations, from which it follows that they are equally expressive, and prove results relating proofs of program properties, in the two presentations. We study issues that arise in programming with primitive recursion over non-free datatypes such as lists, bags and sets. Programs written in this style can lack a meaning in the sense that their outputs may be sensitive to the choice of input expression. We are, thus, naturally lead to a set-theoretic denotational semantics with partial functions. We set up a logic for reasoning about the definedness of terms and a deterministic and terminating evaluator. The logic is shown to be sound in the model, and its recursion free fragment is shown to be complete for proving definedness of recursion free programs. The logic is then shown to be as strong as the evaluator, and this implies that the evaluator is compatible with the provable equivalence between different set (or bag, or list) expressions . Oftentimes, the same non-free datatype may have different presentations, and it is not clear a priori whether programming and reasoning with the two presentations are equivalent. We formulate these questions, precisely, in the context of alternative presentations of the list, bag, and set datatypes and study some aspects of these questions. In particular, we establish back-and-forth translations between the two presentations, from which it follows that they are equally expressive, and prove results relating proofs of program properties, in the two presentations.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Computational and Programming Aspects of Transition Elements in a Three-dimensional Finite Element Program

The performance of any finite element (FE) structural analysis is directly related to the global number of nodes and degrees of freedom (DOF) of the discretized structure and mesh distribution attributes. It is obvious that the appropriate numerical analysis needs finer elements in the zone of interest, e.g. zone of high stress concentration and intensity, and coarser elements for farther porti...

متن کامل

Integrating Lists, Multisets, and Sets in a Logic Programming Framework

The first order theories of lists, bags, compact-lists (i.e., lists where the number of contiguous occurrences of each element is immaterial), and sets are introduced via axioms. Such axiomatizations are shown to be especially suitable for the integration with free functor symbols governed by the classical Clark’s axioms in the context of Constraint Logic Programming. Adaptations of the extensi...

متن کامل

Analytical aspects of the interval unilateral quadratic matrix equations and their united solution sets

This paper introduces the emph{interval unilateral quadratic matrix equation}, $IUQe$ and attempts to find various analytical results on its AE-solution sets in which $A,B$ and $CCC$ are known real interval matrices, while $X$ is an unknown matrix. These results are derived from a generalization of some results of Shary. We also give sufficient conditions for non-emptiness of some quasi-solutio...

متن کامل

Programming with partially specified aggregates in Java

Various forms of data aggregates, e.g., arrays, lists, sets, etc., are usually provided by programming languages, either as primitive entities or as additional features made available by standard libraries. In conventional programming languages these data structures are usually specified by completely and precisely enumerating all their constituent elements. Conversely, in (constraint) logic pr...

متن کامل

Towards a Theory of Bulk Types

A database programming language can model application domains most naturally if it supports several bulk types, e.g., lists, sets, and relations. Indeed some persistent programming languages permit the programmer to deene new bulk types that are appropriate to the application domain. Such a richly typed language tends to be complex, since constructs must be provided to declare, construct, inspe...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1991